<?php

class TdCheckboxField extends TdFormField {
  public $checked;

  function __construct($id, $template="") {
    parent::__construct($id, $template);
  }


  
  
  function __toString() {
  	$pout = parent::__toString();
  	if ($pout != "") {
  		return $pout;
  	}
  
  	ob_start();
  
  	if (isset($this->label)) {
  		print($this->label);
  	}
  	print "<input id=\"".$this->id."\" name=\"".$this->name."\" type=\"checkbox\" value=\"".$this->value."\" ".($this->checked?"checked":"")." \/>";  
  
  
  	return ob_get_clean();
  }
  
  
  function setChecked($value) {
  	$this->checked = $value;
  }
  function getChecked() {
  	return $this->checked;
  }
  
}

?>
